<?php $this->load->module('mobile/index/header', $common);?>
<link rel="stylesheet" href="<?php echo URLPRE;?>static/template/<?php echo MOBILE_TEMPLATE_NAME?>/mobile/css/style1.css?_=22121" type="text/css">
<style>
.chengjiren-price input[type="button"] {
    width: 60%;
    height: 2rem;
    margin-top: 0.5rem;
    background-color:#349cd1!important;
    border-radius: 5px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: bold;
}
.linegrey{margin-bottom:0!important;}
</style>
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/main.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/dialog.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/base.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/index.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/line.css" />
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/mobilecommon.js"></script>
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/slider.js"></script>
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/dialog.js"></script>
<div class="content">
    <div id="list">

                <div class="list-item fn-clear">
                    <div class="info">
                        <h5><?php echo $info['name'] ?$info['name'] :$info['order_title'];?></h5>
                        <div class="i-note">
                            <p class="price">
                                <?php if (!empty($info['order_account'])) :?>
                                    ¥<?php echo ($info['order_account']);?>
                                <?php endif; ?>
                            </p>
                            <p class="c_mt">数量：<?php echo $info['order_num'];?></p>
                            <p class="c_mt">订单编号：<?php echo $info['order_sn'];?></p>
                            <p class="c_mt">订单状态：<?php echo $info['order_status_name'];?></p>
                            <p class="c_mt">支付状态：<?php echo $info['pay_status_name'];?></p>
                            <p class="c_mt">出行时间：<?php echo $info['order_date'];?></p>
                            <p class="c_mt">下单时间：<?php echo $info['add_time'];?></p>
                        </div>
                    </div>

                </div>

    </div>

    <?php
    if($user_id){?>
<!--    <div class="col_div">-->
<!--        --><?php //if($info['pay_identify']=='1'):?>
<!--        <a href="--><?php //echo $info['pay_url'];?><!--" class="btn btn-orange btn_submit" title="立即支付">立即支付</a>-->
<!--        --><?php //endif ;?>
<!--        --><?php //if($info['cancel_identify']=='1'):?>
<!--            <a href="javascript:void(0)" class="btn btn-grey btn_cancel" title="立即取消">取消</a>-->
<!--        --><?php //endif ;?>
<!--    </div>-->

        <div class="linegrey"></div>
        <div class="chengjiren-price">
            <p>订单总额：<b>￥<?php echo $info['order_account']?></b></p>
        <?php if($info['pay_identify']=='1' && (isset($info['payment_method']) ? $info['payment_method'] ==1 : 1)){?>
            <p><a href="<?php echo $info['pay_url'];?>"><input type="button" value="立即支付"></a></p>
        <?php }?>
        <?php if($info['cancel_identify']=='1'):?>
            <p><input type="button" class="btn_cancel" value="取消订单"></p>
        <?php endif ;?>
        </div>

    <?php }?>


</div>
<?php $this->load->module('mobile/index/footer', $common);?>
<script type="text/javascript">
    function alert_popup(text){
        $.dialog({
            style:'tip',
            width:200,
            closeTime:1000,
            content: '<p style="text-align: center">'+text+'</p>'
        }).open();
    }

    var order_id = <?php  echo $info['order_id'];?>  ;
    $(function(){
        var slid = $("#sliderimg").slider({
            loop: true
        });

        $('.btn_list').click(function(){
            window.location.href = '<?php echo site_url('mobile/order/ticket_list')?>';
        });
        $('.btn_cancel').click(function(){

            if(confirm('确定要取消订单吗？')) {
                $.post('<?php  echo $info['cancel_url'];?>', {
                    order_id: order_id
                }, function (data) {
                    alert_popup(data.info);
                    if (data.status == '1') {

                        setTimeout(function(){
                            window.location.reload();
                        }, 1000);
                    }
                }, 'json');
            }
        })

    });
</script>